/*
 Navicat Premium Data Transfer

 Source Server         : localhostDB
 Source Server Type    : MySQL
 Source Server Version : 80026
 Source Host           : localhost:3306
 Source Schema         : permission

 Target Server Type    : MySQL
 Target Server Version : 80026
 File Encoding         : 65001

 Date: 20/11/2023 22:03:50
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_menu_type
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu_type`;
CREATE TABLE `sys_menu_type` (
  `id` varchar(32) NOT NULL COMMENT '主键ID',
  `type` tinyint(1) DEFAULT NULL COMMENT '菜单类型',
  `name` varchar(18) DEFAULT NULL COMMENT '类型名称',
  PRIMARY KEY (`id`),
  KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_menu_type
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu_type` VALUES ('1528236518018150402', 0, '一级菜单');
INSERT INTO `sys_menu_type` VALUES ('1528236828086267906', 1, '子菜单');
INSERT INTO `sys_menu_type` VALUES ('1528236877470003202', 2, '按钮权限');
COMMIT;

-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
  `id` varchar(32) NOT NULL COMMENT '主键ID',
  `parent_id` varchar(32) DEFAULT NULL COMMENT '父ID',
  `name` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '菜单名称',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '访问路由',
  `component` varchar(255) DEFAULT NULL COMMENT '组件路由',
  `router_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '路由名称',
  `redirect` varchar(255) DEFAULT NULL COMMENT '重定向路由',
  `menu_type` tinyint DEFAULT NULL COMMENT '菜单类型(0:一级菜单，1:子菜单，2:按钮权限)',
  `icon` varchar(255) DEFAULT NULL COMMENT '菜单图标',
  `is_route` bit(1) DEFAULT b'1' COMMENT '是否路由菜单(0:不是，1:是（默认值1）)',
  `is_leaf` bit(1) DEFAULT NULL COMMENT '是否叶子节点(1:是，0:不是)',
  `keep_alive` bit(1) DEFAULT b'1' COMMENT '是否缓存该页面(1:是，0:不是)',
  `hidden` bit(1) DEFAULT b'0' COMMENT '是否隐藏路由(0否，1是)',
  `create_by` varchar(32) DEFAULT NULL COMMENT '创建人',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(32) DEFAULT NULL COMMENT '更新人',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `del_flag` bit(1) DEFAULT b'0' COMMENT '是否删除(0:正常，1:已删除)',
  PRIMARY KEY (`id`),
  KEY `menu_type` (`menu_type`),
  CONSTRAINT `sys_permission_ibfk_1` FOREIGN KEY (`menu_type`) REFERENCES `sys_menu_type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_permission` VALUES ('1528412729008832514', '', '首页', '/HomeView', 'views/HomeView', NULL, '', 0, 'house', b'1', NULL, b'0', b'0', '系统账号', '2022-05-23 00:00:00', '系统账号', '2022-05-25 02:03:09', b'0');
INSERT INTO `sys_permission` VALUES ('1528956632116047873', '', '系统管理', '/SystemView', 'views/SystemView', NULL, '/SystemView/UserView', 0, 'gear', b'1', NULL, b'0', b'0', '系统账号', '2022-05-24 12:30:42', '系统账号', '2022-05-24 21:01:27', b'0');
INSERT INTO `sys_permission` VALUES ('1528959283499184129', '1528956632116047873', '用户管理', '/SystemView/UserView', 'views/UserView', NULL, NULL, 1, NULL, b'1', NULL, b'0', b'0', '系统账号', '2022-05-24 12:41:15', '系统账号', '2022-05-24 14:21:17', b'0');
INSERT INTO `sys_permission` VALUES ('1528968459726172161', '1528956632116047873', '角色管理', '/SystemView/RoleView', 'views/RoleView', NULL, NULL, 1, NULL, b'1', NULL, b'0', b'0', '系统账号', '2022-05-24 13:17:42', '系统账号', '2022-05-24 13:17:42', b'0');
INSERT INTO `sys_permission` VALUES ('1528969301791420417', '1528956632116047873', '菜单管理', '/SystemView/MenuView', 'views/MenuView', NULL, NULL, 1, NULL, b'1', NULL, b'0', b'0', '系统账号', '2022-05-24 13:21:03', '系统账号', '2022-05-24 13:21:03', b'0');
INSERT INTO `sys_permission` VALUES ('1528969755921297410', '1528956632116047873', '菜单类型管理', '/SystemView/MenuTypeView', 'views/MenuTypeView', NULL, NULL, 1, NULL, b'1', NULL, b'0', b'0', '系统账号', '2022-05-24 13:22:51', '系统账号', '2022-05-24 13:22:51', b'0');
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` varchar(32) NOT NULL COMMENT '主键ID',
  `role_name` varchar(18) NOT NULL COMMENT '角色名称',
  `role_code` varchar(18) NOT NULL COMMENT '角色编码',
  `description` varchar(32) DEFAULT NULL COMMENT '角色描述',
  `create_by` varchar(18) DEFAULT NULL COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(18) DEFAULT NULL COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES ('1530071865656094721', '管理员', 'admin', '管理员', '系统账号', '2022-05-27 14:22:15', '系统账号', '2022-05-27 14:22:15');
INSERT INTO `sys_role` VALUES ('1530072242879213570', '人力资源部', 'hr', '人力资源部', '系统账号', '2022-05-27 14:23:45', '系统账号', '2022-05-27 14:23:45');
INSERT INTO `sys_role` VALUES ('1530072553429676034', '测试人员', 'test', '临时角色', '系统账号', '2022-05-27 14:24:59', '系统账号', '2022-05-27 14:24:59');
INSERT INTO `sys_role` VALUES ('1530072788050653186', '账务出纳', 'caiwu', NULL, '系统账号', '2022-05-27 14:25:55', '系统账号', '2022-05-27 14:25:55');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
  `id` varchar(32) NOT NULL COMMENT '主键ID',
  `role_id` varchar(32) DEFAULT NULL COMMENT '角色ID',
  `permission_id` varchar(32) DEFAULT NULL COMMENT '权限ID',
  PRIMARY KEY (`id`),
  KEY `role_id` (`role_id`),
  KEY `permission_id` (`permission_id`),
  CONSTRAINT `sys_role_permission_ibfk_1` FOREIGN KEY (`role_id`) REFERENCES `sys_role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `sys_role_permission_ibfk_2` FOREIGN KEY (`permission_id`) REFERENCES `sys_permission` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_permission` VALUES ('1530495130757246977', '1530071865656094721', '1528412729008832514');
INSERT INTO `sys_role_permission` VALUES ('1530495130774024194', '1530071865656094721', '1528956632116047873');
INSERT INTO `sys_role_permission` VALUES ('1530495130774024195', '1530071865656094721', '1528959283499184129');
INSERT INTO `sys_role_permission` VALUES ('1530495130782412802', '1530071865656094721', '1528968459726172161');
INSERT INTO `sys_role_permission` VALUES ('1530495130782412803', '1530071865656094721', '1528969301791420417');
INSERT INTO `sys_role_permission` VALUES ('1530495130782412804', '1530071865656094721', '1528969755921297410');
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` varchar(32) NOT NULL COMMENT 'ID',
  `account` varchar(32) NOT NULL COMMENT '账号',
  `username` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用户名',
  `password` varchar(32) NOT NULL COMMENT '密码',
  `salt` varchar(6) NOT NULL COMMENT '盐',
  `avatar` varchar(255) DEFAULT NULL COMMENT '头像',
  `email` varchar(32) DEFAULT NULL COMMENT '邮箱',
  `phone` varchar(11) DEFAULT NULL COMMENT '电话',
  `status` bit(1) NOT NULL DEFAULT b'0' COMMENT '状态(0-正常，1-冻结)',
  `del_flag` bit(1) NOT NULL DEFAULT b'0' COMMENT '删除状态（0-正常，1-已删除）',
  `create_by` varchar(18) DEFAULT NULL COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES ('1527996072423587841', '110101199003071735', '系统账号', '123456', 'kfwoox', NULL, 'scitctocdtu@qq.com', '15281056531', b'0', b'0', NULL, '2022-05-21 00:00:00', '系统账号', '2022-05-27 23:49:52');
INSERT INTO `sys_user` VALUES ('1529456562425344001', '511521199807076171', '张健强', '123456', 'jqhmlr', NULL, 'scitctocdtu@qq.com', '15281056531', b'0', b'1', '系统账号', '2022-05-25 00:00:00', '系统账号', '2022-05-25 00:00:00');
INSERT INTO `sys_user` VALUES ('1529457711031316482', '511521199807076171', '张健强', '123456', 'rb5vf1', NULL, 'scitctocdtu@qq.com', '15281056531', b'0', b'1', '系统账号', '2022-05-25 21:41:49', '系统账号', '2022-05-25 21:44:51');
INSERT INTO `sys_user` VALUES ('1529458697175101441', '511521199807076171', '张先生', '15281056531', '18jjrh', '/uploadPhoto/1529458697175101441/UserAvatar.JPG', 'scitctocdtu@qq.com', '15281056531', b'0', b'0', '系统账号', '2022-05-25 21:45:44', '系统账号', '2022-05-26 23:28:21');
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `id` varchar(32) NOT NULL COMMENT '主键ID',
  `user_id` varchar(32) DEFAULT NULL COMMENT '用户ID',
  `role_id` varchar(32) DEFAULT NULL COMMENT '角色ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` VALUES ('1530214712741056513', '1527996072423587841', '1530071865656094721');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
